//
//  BarrageWalkSelfTextSprite.m
//  MessageCell
//
//  Created by frank on 16/8/8.
//  Copyright © 2016年 yr. All rights reserved.
//

#import "BarrageWalkSelfTextSprite.h"
#import "MLEmojiLabel.h"
#import "WTCategories.h"
#import <Masonry.h>
@implementation BarrageWalkSelfTextSprite

- (UIView *)bindingView
{
//    
//    MLEmojiLabel * label = [[MLEmojiLabel alloc]initWithFrame:CGRectMake(0, 0, 200, 30)];
//
//    label.text = self.text;
//    label.textAlignment = NSTextAlignmentCenter;
//    label.textColor = [UIColor whiteColor];
//    label.font = [UIFont systemFontOfSize:15];
//    if (self.cornerRadius > 0) {
//        label.layer.cornerRadius = self.cornerRadius;
//        label.clipsToBounds = YES;
//    }
//    label.layer.borderColor = [UIColor redColor].CGColor;
//    label.layer.borderWidth = 5.0f;
//    label.backgroundColor = self.backgroundColor;
//    label.lineBreakMode = NSLineBreakByCharWrapping;
//    label.isNeedAtAndPoundSign = YES;
//    return label;
    
    UIImageView *backView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 400, 60)];
    backView.image = [UIImage wt_imageWithName:@"wt_avatar"];
    backView.contentMode = UIViewContentModeScaleAspectFit;
    MLEmojiLabel * label = [[MLEmojiLabel alloc]initWithFrame:CGRectMake(0, 0, 400, 60)];
    
    [backView addSubview:label];
    
//    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
//    button.backgroundColor = [UIColor blackColor];
//    button.frame = CGRectMake(0, 0, 60, 20);
//    
//    [backView addSubview:button];
    label.text = self.text;
    label.textAlignment = NSTextAlignmentCenter;
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont systemFontOfSize:15];
    if (self.cornerRadius > 0) {
        label.layer.cornerRadius = self.cornerRadius;
        label.clipsToBounds = YES;
    }
    label.layer.borderColor = [UIColor yellowColor].CGColor;
    label.layer.borderWidth = 1.0f;
    label.backgroundColor = self.backgroundColor;
    label.lineBreakMode = NSLineBreakByCharWrapping;
    label.isNeedAtAndPoundSign = YES;
    return backView;
}

@end
